<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf"
  xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf"
  xmlns:system="clr-namespace:System;assembly=mscorlib">

  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="../Brushes/MaterialDesign/MaterialDesignTheme.Theme.xaml"/>
  </ResourceDictionary.MergedDictionaries>

  <converters:MathMultipleConverter x:Key="MathMlpMultipleConverter" Operation="Multiply"/>

  <Style x:Key="MaterialDesignExpanderToggleButton" TargetType="{x:Type ToggleButton}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="Transparent">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CheckStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Unchecked" To="Checked">
                    <VisualTransition.GeneratedEasingFunction>
                      <QuarticEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                        <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="-180"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition GeneratedDuration="0" To="Unchecked">
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                        <EasingDoubleKeyFrame KeyTime="0" Value="-180"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition GeneratedDuration="0" To="Checked">
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                        <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="Checked" GeneratedDuration="0" To="Unchecked">
                    <VisualTransition.GeneratedEasingFunction>
                      <QuarticEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                        <EasingDoubleKeyFrame KeyTime="0" Value="-180"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Checked">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                      <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="-180"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unchecked">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                      <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <wpf:PackIcon Kind="ChevronDown" Opacity=".38" x:Name="ExpandPath" RenderTransformOrigin="0.5,0.5" Height="24" Width="24" Foreground="{TemplateBinding Foreground}">
              <wpf:PackIcon.RenderTransform>
                <TransformGroup>
                  <ScaleTransform/>
                  <SkewTransform/>
                  <RotateTransform/>
                  <TranslateTransform/>
                </TransformGroup>
              </wpf:PackIcon.RenderTransform>
            </wpf:PackIcon>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="HorizontalAlignment" Value="Left"/>
    <Setter Property="VerticalAlignment" Value="Stretch"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="{TemplateBinding Background}" Padding="12,24,12,24">
            <Grid>
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition/>
              </Grid.RowDefinitions>
              <ToggleButton Name="PART_Chevron"
                Grid.Row="0"
                HorizontalAlignment="Center"
                Foreground="{TemplateBinding Foreground}"
                IsChecked="{Binding Path=IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                Style="{StaticResource MaterialDesignExpanderToggleButton}"
                RenderTransformOrigin="0.5,0.5">
                <ToggleButton.RenderTransform>
                  <RotateTransform Angle="-90"/>
                </ToggleButton.RenderTransform>
              </ToggleButton>
              <ContentPresenter
                Grid.Row="1"
                HorizontalAlignment="Center"
                Margin="0,16,0,0"
                Content="{TemplateBinding Content}"
                VerticalAlignment="Top"
                TextBlock.FontFamily="{TemplateBinding TextBlock.FontFamily}"
                TextBlock.FontSize="{TemplateBinding TextBlock.FontSize}"/>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignExpanderLeftHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="HorizontalAlignment" Value="Right"/>
    <Setter Property="VerticalAlignment" Value="Stretch"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="{TemplateBinding Background}" Padding="12,24,12,24">
            <Grid>
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition/>
              </Grid.RowDefinitions>
              <ToggleButton Name="PART_Chevron"
                Grid.Row="0"
                HorizontalAlignment="Center"
                Foreground="{TemplateBinding Foreground}"
                IsChecked="{Binding Path=IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                Style="{StaticResource MaterialDesignExpanderToggleButton}"
                RenderTransformOrigin="0.5,0.5">
                <ToggleButton.RenderTransform>
                  <RotateTransform Angle="90"/>
                </ToggleButton.RenderTransform>
              </ToggleButton>
              <ContentPresenter
                Grid.Row="1"
                HorizontalAlignment="Center"
                Margin="0,16,0,0"
                Content="{TemplateBinding Content}"
                VerticalAlignment="Top"
                TextBlock.FontFamily="{TemplateBinding TextBlock.FontFamily}"
                TextBlock.FontSize="{TemplateBinding TextBlock.FontSize}"/>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
    <Setter Property="VerticalAlignment" Value="Center"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="{TemplateBinding Background}" Padding="24,12,24,12">
            <Grid>
              <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
              </Grid.ColumnDefinitions>
              <ContentPresenter
                Content="{TemplateBinding Content}"
                ContentTemplate="{TemplateBinding ContentTemplate}"
                ContentStringFormat="{TemplateBinding ContentStringFormat}"
                ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                VerticalAlignment="Center"
                Margin="0,0,16,0"
                TextBlock.FontFamily="{TemplateBinding TextBlock.FontFamily}"
                TextBlock.FontSize="{TemplateBinding TextBlock.FontSize}"/>
              <ToggleButton Name="PART_Chevron"
                Grid.Column="1"
                VerticalAlignment="Center"
                Foreground="{TemplateBinding Foreground}"
                IsChecked="{Binding Path=IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                Style="{StaticResource MaterialDesignExpanderToggleButton}"/>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignExpanderUpHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
    <Setter Property="VerticalAlignment" Value="Center"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="{TemplateBinding Background}" Padding="24,12,24,12">
            <Grid>
              <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
              </Grid.ColumnDefinitions>
              <ContentPresenter VerticalAlignment="Center" Content="{TemplateBinding Content}" Margin="0,0,16,0" TextBlock.FontFamily="{TemplateBinding TextBlock.FontFamily}" TextBlock.FontSize="{TemplateBinding TextBlock.FontSize}"/>
              <ToggleButton Name="PART_Chevron"
                IsChecked="{Binding Path=IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                VerticalAlignment="Center"
                Foreground="{TemplateBinding Foreground}"
                Style="{StaticResource MaterialDesignExpanderToggleButton}"
                RenderTransformOrigin="0.5,0.5"
                Grid.Column="1">
                <ToggleButton.RenderTransform>
                  <RotateTransform Angle="-180"/>
                </ToggleButton.RenderTransform>
              </ToggleButton>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignExpander" TargetType="{x:Type Expander}">
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="Background" Value="{DynamicResource MaterialDesignPaper}"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Top"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Expander}">
          <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="ExpansionStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="0" To="Expanded">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                        <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                      </ObjectAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="1" Duration="0:0:0.3"/>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition GeneratedDuration="0" To="Collapsed">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                        <DiscreteObjectKeyFrame KeyTime="0:0:0.3" Value="{x:Static Visibility.Collapsed}"/>
                      </ObjectAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="0" Duration="0:0:0.3"/>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Expanded">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="1" Duration="0"/>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Collapsed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="0" Duration="0"/>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <DockPanel Background="{TemplateBinding Background}">
              <ToggleButton
                Name="HeaderSite"
                Focusable="False"
                IsTabStop="False"
                DockPanel.Dock="Top"
                BorderThickness="0"
                Cursor="Hand"
                IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                Style="{StaticResource MaterialDesignExpanderDownHeaderStyle}"
                TextElement.FontSize="15"
                Opacity=".87"
                Foreground="{TemplateBinding Foreground}"
                Content="{TemplateBinding Header}"
                ContentTemplate="{TemplateBinding HeaderTemplate}"
                ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
                ContentStringFormat="{TemplateBinding HeaderStringFormat}"/>
              <Border Name="ContentSite" DockPanel.Dock="Bottom">
                <StackPanel Name="ContentPanel" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                  <StackPanel.Height>
                    <MultiBinding Converter="{StaticResource MathMlpMultipleConverter}">
                      <Binding ElementName="PART_Content" Path="ActualHeight"/>
                      <Binding ElementName="PART_Content" Path="Opacity"/>
                    </MultiBinding>
                  </StackPanel.Height>
                  <StackPanel.Width>
                    <MultiBinding Converter="{StaticResource MathMlpMultipleConverter}">
                      <Binding ElementName="PART_Content" Path="ActualWidth"/>
                      <Binding ElementName="PART_Content" Path="Opacity"/>
                    </MultiBinding>
                  </StackPanel.Width>
                  <ContentPresenter Name="PART_Content" Focusable="False" ContentTemplate="{TemplateBinding ContentTemplate}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"/>
                </StackPanel>
              </Border>
            </DockPanel>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="ExpandDirection" Value="Right">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Right"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Horizontal"/>
              <Setter Property="Height" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignExpanderRightHeaderStyle}"/>
            </Trigger>

            <Trigger Property="ExpandDirection" Value="Left">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Left"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Horizontal"/>
              <Setter Property="Height" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignExpanderLeftHeaderStyle}"/>
            </Trigger>

            <Trigger Property="ExpandDirection" Value="Up">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Top"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Vertical"/>
              <Setter Property="Width" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignExpanderUpHeaderStyle}"/>
            </Trigger>

            <Trigger Property="ExpandDirection" Value="Down">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Top"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Bottom"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Vertical"/>
              <Setter Property="Width" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignExpanderDownHeaderStyle}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignSlimExpanderToggleButton" TargetType="{x:Type ToggleButton}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="Transparent">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CheckStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Unchecked" To="Checked">
                    <VisualTransition.GeneratedEasingFunction>
                      <QuarticEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                        <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="-180"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition GeneratedDuration="0" To="Unchecked">
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                        <EasingDoubleKeyFrame KeyTime="0" Value="-180"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition GeneratedDuration="0" To="Checked">
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                        <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="Checked" GeneratedDuration="0" To="Unchecked">
                    <VisualTransition.GeneratedEasingFunction>
                      <QuarticEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                        <EasingDoubleKeyFrame KeyTime="0" Value="-180"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Checked">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                      <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="-180"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unchecked">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                      <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <wpf:PackIcon Kind="ChevronDown" x:Name="ExpandPath" RenderTransformOrigin="0.5,0.5" Margin="4" Height="16" Width="16" Foreground="{TemplateBinding Foreground}">
              <wpf:PackIcon.RenderTransform>
                <TransformGroup>
                  <ScaleTransform/>
                  <SkewTransform/>
                  <RotateTransform/>
                  <TranslateTransform/>
                </TransformGroup>
              </wpf:PackIcon.RenderTransform>
            </wpf:PackIcon>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignSlimExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="HorizontalAlignment" Value="Left"/>
    <Setter Property="VerticalAlignment" Value="Stretch"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="{TemplateBinding Background}">
            <Grid>
              <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition Height="Auto"/>
              </Grid.RowDefinitions>
              <ContentPresenter
                Grid.Row="0"
                HorizontalAlignment="Center"
                Margin="0,16,0,0"
                Content="{TemplateBinding Content}"
                VerticalAlignment="Top"
                TextBlock.FontFamily="{TemplateBinding TextBlock.FontFamily}"
                TextBlock.FontSize="{TemplateBinding TextBlock.FontSize}"/>
              <ToggleButton Name="PART_Chevron"
                Grid.Row="1"
                HorizontalAlignment="Center"
                Foreground="{TemplateBinding Foreground}"
                IsChecked="{Binding Path=IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                Style="{StaticResource MaterialDesignSlimExpanderToggleButton}"
                RenderTransformOrigin="0.5,0.5">
                <ToggleButton.RenderTransform>
                  <RotateTransform Angle="-90"/>
                </ToggleButton.RenderTransform>
              </ToggleButton>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignSlimExpanderLeftHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="HorizontalAlignment" Value="Right"/>
    <Setter Property="VerticalAlignment" Value="Stretch"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="{TemplateBinding Background}">
            <Grid>
              <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition Height="Auto"/>
              </Grid.RowDefinitions>
              <ContentPresenter
                Grid.Row="0"
                HorizontalAlignment="Center"
                Margin="0,16,0,0"
                Content="{TemplateBinding Content}"
                VerticalAlignment="Top"
                TextBlock.FontFamily="{TemplateBinding TextBlock.FontFamily}"
                TextBlock.FontSize="{TemplateBinding TextBlock.FontSize}"/>
              <ToggleButton Name="PART_Chevron"
                Grid.Row="1"
                HorizontalAlignment="Center"
                Foreground="{TemplateBinding Foreground}"
                IsChecked="{Binding Path=IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                Style="{StaticResource MaterialDesignSlimExpanderToggleButton}"
                RenderTransformOrigin="0.5,0.5">
                <ToggleButton.RenderTransform>
                  <RotateTransform Angle="90"/>
                </ToggleButton.RenderTransform>
              </ToggleButton>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignSlimExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
    <Setter Property="VerticalAlignment" Value="Center"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="{TemplateBinding Background}">
            <Grid>
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition/>
              </Grid.ColumnDefinitions>
              <ToggleButton Name="PART_Chevron"
                Grid.Column="0"
                VerticalAlignment="Center"
                Foreground="{TemplateBinding Foreground}"
                IsChecked="{Binding Path=IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                Style="{StaticResource MaterialDesignSlimExpanderToggleButton}"/>
              <ContentPresenter
                Grid.Column="1"
                Content="{TemplateBinding Content}"
                ContentTemplate="{TemplateBinding ContentTemplate}"
                ContentStringFormat="{TemplateBinding ContentStringFormat}"
                ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                VerticalAlignment="Center"
                Margin="0,0,16,0"
                TextBlock.FontFamily="{TemplateBinding TextBlock.FontFamily}"
                TextBlock.FontSize="{TemplateBinding TextBlock.FontSize}"/>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignSlimExpanderUpHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
    <Setter Property="VerticalAlignment" Value="Center"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="{TemplateBinding Background}">
            <Grid>
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition/>
              </Grid.ColumnDefinitions>
              <ToggleButton Name="PART_Chevron"
                IsChecked="{Binding Path=IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                VerticalAlignment="Center"
                Foreground="{TemplateBinding Foreground}"
                Style="{StaticResource MaterialDesignSlimExpanderToggleButton}"
                RenderTransformOrigin="0.5,0.5"
                Grid.Column="0">
                <ToggleButton.RenderTransform>
                  <RotateTransform Angle="-180"/>
                </ToggleButton.RenderTransform>
              </ToggleButton>
              <ContentPresenter Grid.Column="1" VerticalAlignment="Center" Content="{TemplateBinding Content}" Margin="0,0,16,0" TextBlock.FontFamily="{TemplateBinding TextBlock.FontFamily}" TextBlock.FontSize="{TemplateBinding TextBlock.FontSize}"/>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignSlimExpander" BasedOn="{StaticResource MaterialDesignExpander}" TargetType="{x:Type Expander}">
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Top"/>
    <Setter Property="TextBlock.FontFamily" Value="{DynamicResource MidSubHeaderFontFamily}"/>
    <Setter Property="TextBlock.FontSize" Value="{DynamicResource GroupBoxHeaderFontSize}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Expander}">
          <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="ExpansionStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="0" To="Expanded">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                        <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                      </ObjectAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="1" Duration="0:0:0.3"/>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition GeneratedDuration="0" To="Collapsed">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                        <DiscreteObjectKeyFrame KeyTime="0:0:0.3" Value="{x:Static Visibility.Collapsed}"/>
                      </ObjectAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="0" Duration="0:0:0.3"/>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Expanded">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="1" Duration="0"/>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Collapsed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="0" Duration="0"/>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <DockPanel Background="{TemplateBinding Background}">
              <ToggleButton
                Name="HeaderSite"
                Focusable="False"
                IsTabStop="False"
                DockPanel.Dock="Top"
                BorderThickness="0"
                Cursor="Hand"
                IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                Style="{StaticResource MaterialDesignSlimExpanderDownHeaderStyle}"
                Foreground="{TemplateBinding Foreground}"
                Content="{TemplateBinding Header}"
                ContentTemplate="{TemplateBinding HeaderTemplate}"
                ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
                ContentStringFormat="{TemplateBinding HeaderStringFormat}"/>
              <Border Name="ContentSite" DockPanel.Dock="Bottom">
                <StackPanel Name="ContentPanel" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                  <StackPanel.Height>
                    <MultiBinding Converter="{StaticResource MathMlpMultipleConverter}">
                      <Binding ElementName="PART_Content" Path="ActualHeight"/>
                      <Binding ElementName="PART_Content" Path="Opacity"/>
                    </MultiBinding>
                  </StackPanel.Height>
                  <StackPanel.Width>
                    <MultiBinding Converter="{StaticResource MathMlpMultipleConverter}">
                      <Binding ElementName="PART_Content" Path="ActualWidth"/>
                      <Binding ElementName="PART_Content" Path="Opacity"/>
                    </MultiBinding>
                  </StackPanel.Width>
                  <ContentPresenter Name="PART_Content" Focusable="False" ContentTemplate="{TemplateBinding ContentTemplate}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"/>
                </StackPanel>
              </Border>
            </DockPanel>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="ExpandDirection" Value="Right">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Right"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Horizontal"/>
              <Setter Property="Height" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignSlimExpanderRightHeaderStyle}"/>
            </Trigger>

            <Trigger Property="ExpandDirection" Value="Left">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Left"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Horizontal"/>
              <Setter Property="Height" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignSlimExpanderLeftHeaderStyle}"/>
            </Trigger>

            <Trigger Property="ExpandDirection" Value="Up">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Top"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Vertical"/>
              <Setter Property="Width" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignSlimExpanderUpHeaderStyle}"/>
            </Trigger>

            <Trigger Property="ExpandDirection" Value="Down">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Top"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Bottom"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Vertical"/>
              <Setter Property="Width" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignSlimExpanderDownHeaderStyle}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignSlimFloatingExpanderToggleButton" TargetType="{x:Type ToggleButton}">
    <Setter Property="wpf:ShadowAssist.ShadowDepth" Value="Depth2"/>
    <Setter Property="Background" Value="{DynamicResource MaterialDesignCardBackground}"/>
    <Setter Property="Foreground" Value="{DynamicResource SecondaryAccentBrush}"/>
    <Setter Property="BorderBrush" Value="Transparent"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="Transparent">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CheckStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Unchecked" To="Checked">
                    <VisualTransition.GeneratedEasingFunction>
                      <QuarticEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                        <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="-180"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition GeneratedDuration="0" To="Unchecked">
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                        <EasingDoubleKeyFrame KeyTime="0" Value="-180"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition GeneratedDuration="0" To="Checked">
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                        <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="Checked" GeneratedDuration="0" To="Unchecked">
                    <VisualTransition.GeneratedEasingFunction>
                      <QuarticEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                        <EasingDoubleKeyFrame KeyTime="0" Value="-180"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Checked">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                      <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="-180"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unchecked">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                      <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid Height="16" Width="16" Margin="4">
              <AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(wpf:ShadowAssist.CacheMode)}">
                <Ellipse
                  Fill="{TemplateBinding Background}"
                  Stroke="{TemplateBinding BorderBrush}"
                  StrokeThickness="{TemplateBinding BorderThickness}"
                  Effect="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpf:ShadowAssist.ShadowDepth), Converter={x:Static converters:ShadowConverter.Instance}}"
                  x:Name="border"></Ellipse>
              </AdornerDecorator>
              <wpf:PackIcon Kind="ChevronDown" x:Name="ExpandPath" RenderTransformOrigin="0.5,0.5" Height="16" Width="16" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="Center" VerticalAlignment="Center">
                <wpf:PackIcon.RenderTransform>
                  <TransformGroup>
                    <ScaleTransform/>
                    <SkewTransform/>
                    <RotateTransform/>
                    <TranslateTransform/>
                  </TransformGroup>
                </wpf:PackIcon.RenderTransform>
              </wpf:PackIcon>
            </Grid>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Opacity" Value="{StaticResource DisabledOpacity}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignSlimFloatingExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="HorizontalAlignment" Value="Left"/>
    <Setter Property="VerticalAlignment" Value="Stretch"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="{TemplateBinding Background}">
            <Grid>
              <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition Height="Auto"/>
              </Grid.RowDefinitions>
              <ContentPresenter
                Grid.Row="0"
                HorizontalAlignment="Center"
                Margin="0,16,0,0"
                Content="{TemplateBinding Content}"
                VerticalAlignment="Top"
                TextBlock.Foreground="{TemplateBinding Foreground}"
                TextBlock.FontFamily="{TemplateBinding TextBlock.FontFamily}"
                TextBlock.FontSize="{TemplateBinding TextBlock.FontSize}"/>
              <ToggleButton Name="PART_Chevron"
                Grid.Row="1"
                HorizontalAlignment="Center"
                IsChecked="{Binding Path=IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                Style="{StaticResource MaterialDesignSlimFloatingExpanderToggleButton}"
                RenderTransformOrigin="0.5,0.5">
                <ToggleButton.RenderTransform>
                  <RotateTransform Angle="-90"/>
                </ToggleButton.RenderTransform>
              </ToggleButton>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignSlimFloatingExpanderLeftHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="HorizontalAlignment" Value="Right"/>
    <Setter Property="VerticalAlignment" Value="Stretch"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="{TemplateBinding Background}">
            <Grid>
              <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition Height="Auto"/>
              </Grid.RowDefinitions>
              <ContentPresenter
                Grid.Row="0"
                HorizontalAlignment="Center"
                Margin="0,16,0,0"
                Content="{TemplateBinding Content}"
                VerticalAlignment="Top"
                TextBlock.Foreground="{TemplateBinding Foreground}"
                TextBlock.FontFamily="{TemplateBinding TextBlock.FontFamily}"
                TextBlock.FontSize="{TemplateBinding TextBlock.FontSize}"/>
              <ToggleButton Name="PART_Chevron"
                Grid.Row="1"
                HorizontalAlignment="Center"
                IsChecked="{Binding Path=IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                Style="{StaticResource MaterialDesignSlimFloatingExpanderToggleButton}"
                RenderTransformOrigin="0.5,0.5">
                <ToggleButton.RenderTransform>
                  <RotateTransform Angle="90"/>
                </ToggleButton.RenderTransform>
              </ToggleButton>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignSlimFloatingExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
    <Setter Property="VerticalAlignment" Value="Center"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="{TemplateBinding Background}">
            <Grid>
              <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
              </Grid.ColumnDefinitions>
              <ContentPresenter
                Grid.Column="0"
                Content="{TemplateBinding Content}"
                ContentTemplate="{TemplateBinding ContentTemplate}"
                ContentStringFormat="{TemplateBinding ContentStringFormat}"
                ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                VerticalAlignment="Center"
                Margin="0,0,16,0"
                TextBlock.Foreground="{TemplateBinding Foreground}"
                TextBlock.FontFamily="{TemplateBinding TextBlock.FontFamily}"
                TextBlock.FontSize="{TemplateBinding TextBlock.FontSize}"/>
              <ToggleButton Name="PART_Chevron" Grid.Column="1" VerticalAlignment="Center" IsChecked="{Binding Path=IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource MaterialDesignSlimFloatingExpanderToggleButton}"/>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignSlimFloatingExpanderUpHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
    <Setter Property="VerticalAlignment" Value="Center"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="{TemplateBinding Background}">
            <Grid>
              <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
              </Grid.ColumnDefinitions>
              <ContentPresenter
                Grid.Column="0"
                VerticalAlignment="Center"
                Content="{TemplateBinding Content}"
                Margin="0,0,16,0"
                TextBlock.Foreground="{TemplateBinding Foreground}"
                TextBlock.FontFamily="{TemplateBinding TextBlock.FontFamily}"
                TextBlock.FontSize="{TemplateBinding TextBlock.FontSize}"/>
              <ToggleButton Name="PART_Chevron"
                IsChecked="{Binding Path=IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                VerticalAlignment="Center"
                Style="{StaticResource MaterialDesignSlimFloatingExpanderToggleButton}"
                RenderTransformOrigin="0.5,0.5"
                Grid.Column="1">
                <ToggleButton.RenderTransform>
                  <RotateTransform Angle="-180"/>
                </ToggleButton.RenderTransform>
              </ToggleButton>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignSlimFloatingExpander" BasedOn="{StaticResource MaterialDesignExpander}" TargetType="{x:Type Expander}">
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="TextBlock.FontFamily" Value="{DynamicResource MidSubHeaderFontFamily}"/>
    <Setter Property="TextBlock.FontSize" Value="{DynamicResource GroupBoxHeaderFontSize}"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Top"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Expander}">
          <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="ExpansionStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="0" To="Expanded">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                        <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                      </ObjectAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="1" Duration="0:0:0.3"/>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition GeneratedDuration="0" To="Collapsed">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                        <DiscreteObjectKeyFrame KeyTime="0:0:0.3" Value="{x:Static Visibility.Collapsed}"/>
                      </ObjectAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="0" Duration="0:0:0.3"/>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Expanded">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="1" Duration="0"/>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Collapsed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="0" Duration="0"/>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <DockPanel Background="{TemplateBinding Background}">
              <ToggleButton
                Name="HeaderSite"
                Focusable="False"
                IsTabStop="False"
                DockPanel.Dock="Top"
                BorderThickness="0"
                Cursor="Hand"
                IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                Style="{StaticResource MaterialDesignSlimFloatingExpanderDownHeaderStyle}"
                Foreground="{TemplateBinding Foreground}"
                TextBlock.FontFamily="{TemplateBinding TextBlock.FontFamily}"
                TextBlock.FontSize="{TemplateBinding TextBlock.FontSize}"
                Content="{TemplateBinding Header}"
                ContentTemplate="{TemplateBinding HeaderTemplate}"
                ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
                ContentStringFormat="{TemplateBinding HeaderStringFormat}"/>
              <Border Name="ContentSite" DockPanel.Dock="Bottom">
                <StackPanel Name="ContentPanel" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                  <StackPanel.Height>
                    <MultiBinding Converter="{StaticResource MathMlpMultipleConverter}">
                      <Binding ElementName="PART_Content" Path="ActualHeight"/>
                      <Binding ElementName="PART_Content" Path="Opacity"/>
                    </MultiBinding>
                  </StackPanel.Height>
                  <StackPanel.Width>
                    <MultiBinding Converter="{StaticResource MathMlpMultipleConverter}">
                      <Binding ElementName="PART_Content" Path="ActualWidth"/>
                      <Binding ElementName="PART_Content" Path="Opacity"/>
                    </MultiBinding>
                  </StackPanel.Width>
                  <ContentPresenter Name="PART_Content" Focusable="False" ContentTemplate="{TemplateBinding ContentTemplate}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"/>
                </StackPanel>
              </Border>
            </DockPanel>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="ExpandDirection" Value="Right">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Right"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Horizontal"/>
              <Setter Property="Height" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignSlimFloatingExpanderRightHeaderStyle}"/>
            </Trigger>

            <Trigger Property="ExpandDirection" Value="Left">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Left"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Horizontal"/>
              <Setter Property="Height" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignSlimFloatingExpanderLeftHeaderStyle}"/>
            </Trigger>

            <Trigger Property="ExpandDirection" Value="Up">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Top"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Vertical"/>
              <Setter Property="Width" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignSlimFloatingExpanderUpHeaderStyle}"/>
            </Trigger>

            <Trigger Property="ExpandDirection" Value="Down">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Top"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Bottom"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Vertical"/>
              <Setter Property="Width" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignSlimFloatingExpanderDownHeaderStyle}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignSlimFlatExpanderToggleButton" TargetType="{x:Type ToggleButton}">
    <Setter Property="wpf:ShadowAssist.ShadowDepth" Value="Depth2"/>
    <Setter Property="Background" Value="{DynamicResource MaterialDesignCardBackground}"/>
    <Setter Property="Foreground" Value="{DynamicResource SecondaryAccentBrush}"/>
    <Setter Property="BorderBrush" Value="Transparent"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="Transparent">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CheckStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition From="Unchecked" To="Checked">
                    <VisualTransition.GeneratedEasingFunction>
                      <QuarticEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                        <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="-180"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition GeneratedDuration="0" To="Unchecked">
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                        <EasingDoubleKeyFrame KeyTime="0" Value="-180"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition GeneratedDuration="0" To="Checked">
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                        <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition From="Checked" GeneratedDuration="0" To="Unchecked">
                    <VisualTransition.GeneratedEasingFunction>
                      <QuarticEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                        <EasingDoubleKeyFrame KeyTime="0" Value="-180"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                      </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Checked">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                      <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="-180"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unchecked">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ExpandPath">
                      <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid Height="16" Width="16" Margin="4">
              <wpf:PackIcon Kind="ChevronDown" x:Name="ExpandPath" RenderTransformOrigin="0.5,0.5" Height="16" Width="16" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="Center" VerticalAlignment="Center">
                <wpf:PackIcon.RenderTransform>
                  <TransformGroup>
                    <ScaleTransform/>
                    <SkewTransform/>
                    <RotateTransform/>
                    <TranslateTransform/>
                  </TransformGroup>
                </wpf:PackIcon.RenderTransform>
              </wpf:PackIcon>
            </Grid>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Opacity" Value="{StaticResource DisabledOpacity}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignSlimFlatExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="HorizontalAlignment" Value="Left"/>
    <Setter Property="VerticalAlignment" Value="Stretch"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="{TemplateBinding Background}">
            <Grid>
              <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition Height="Auto"/>
              </Grid.RowDefinitions>
              <ContentPresenter
                Grid.Row="0"
                HorizontalAlignment="Center"
                Margin="0,16,0,0"
                Content="{TemplateBinding Content}"
                VerticalAlignment="Top"
                TextBlock.Foreground="{TemplateBinding Foreground}"
                TextBlock.FontFamily="{TemplateBinding TextBlock.FontFamily}"
                TextBlock.FontSize="{TemplateBinding TextBlock.FontSize}"/>
              <ToggleButton Name="PART_Chevron"
                Grid.Row="1"
                HorizontalAlignment="Center"
                IsChecked="{Binding Path=IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                Style="{StaticResource MaterialDesignSlimFlatExpanderToggleButton}"
                RenderTransformOrigin="0.5,0.5">
                <ToggleButton.RenderTransform>
                  <RotateTransform Angle="-90"/>
                </ToggleButton.RenderTransform>
              </ToggleButton>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignSlimFlatExpanderLeftHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="HorizontalAlignment" Value="Right"/>
    <Setter Property="VerticalAlignment" Value="Stretch"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="{TemplateBinding Background}">
            <Grid>
              <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition Height="Auto"/>
              </Grid.RowDefinitions>
              <ContentPresenter
                Grid.Row="0"
                HorizontalAlignment="Center"
                Margin="0,16,0,0"
                Content="{TemplateBinding Content}"
                VerticalAlignment="Top"
                TextBlock.Foreground="{TemplateBinding Foreground}"
                TextBlock.FontFamily="{TemplateBinding TextBlock.FontFamily}"
                TextBlock.FontSize="{TemplateBinding TextBlock.FontSize}"/>
              <ToggleButton Name="PART_Chevron"
                Grid.Row="1"
                HorizontalAlignment="Center"
                IsChecked="{Binding Path=IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                Style="{StaticResource MaterialDesignSlimFlatExpanderToggleButton}"
                RenderTransformOrigin="0.5,0.5">
                <ToggleButton.RenderTransform>
                  <RotateTransform Angle="90"/>
                </ToggleButton.RenderTransform>
              </ToggleButton>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignSlimFlatExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
    <Setter Property="VerticalAlignment" Value="Center"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="{TemplateBinding Background}">
            <Grid>
              <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
              </Grid.ColumnDefinitions>
              <ContentPresenter
                Grid.Column="0"
                Content="{TemplateBinding Content}"
                ContentTemplate="{TemplateBinding ContentTemplate}"
                ContentStringFormat="{TemplateBinding ContentStringFormat}"
                ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                VerticalAlignment="Center"
                Margin="0,0,16,0"
                TextBlock.Foreground="{TemplateBinding Foreground}"
                TextBlock.FontFamily="{TemplateBinding TextBlock.FontFamily}"
                TextBlock.FontSize="{TemplateBinding TextBlock.FontSize}"/>
              <ToggleButton Name="PART_Chevron" Grid.Column="1" VerticalAlignment="Center" IsChecked="{Binding Path=IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource MaterialDesignSlimFlatExpanderToggleButton}"/>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignSlimFlatExpanderUpHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
    <Setter Property="VerticalAlignment" Value="Center"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Background="{TemplateBinding Background}">
            <Grid>
              <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
              </Grid.ColumnDefinitions>
              <ContentPresenter
                Grid.Column="0"
                VerticalAlignment="Center"
                Content="{TemplateBinding Content}"
                Margin="0,0,16,0"
                TextBlock.Foreground="{TemplateBinding Foreground}"
                TextBlock.FontFamily="{TemplateBinding TextBlock.FontFamily}"
                TextBlock.FontSize="{TemplateBinding TextBlock.FontSize}"/>
              <ToggleButton Name="PART_Chevron"
                IsChecked="{Binding Path=IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                VerticalAlignment="Center"
                Style="{StaticResource MaterialDesignSlimFlatExpanderToggleButton}"
                RenderTransformOrigin="0.5,0.5"
                Grid.Column="1">
                <ToggleButton.RenderTransform>
                  <RotateTransform Angle="-180"/>
                </ToggleButton.RenderTransform>
              </ToggleButton>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignSlimFlatExpander" BasedOn="{StaticResource MaterialDesignExpander}" TargetType="{x:Type Expander}">
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="TextBlock.FontFamily" Value="{DynamicResource MidSubHeaderFontFamily}"/>
    <Setter Property="TextBlock.FontSize" Value="{DynamicResource GroupBoxHeaderFontSize}"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Top"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Expander}">
          <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="ExpansionStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="0" To="Expanded">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                        <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                      </ObjectAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="1" Duration="0:0:0.3"/>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition GeneratedDuration="0" To="Collapsed">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                        <DiscreteObjectKeyFrame KeyTime="0:0:0.3" Value="{x:Static Visibility.Collapsed}"/>
                      </ObjectAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="0" Duration="0:0:0.3"/>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Expanded">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="1" Duration="0"/>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Collapsed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="0" Duration="0"/>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <DockPanel Background="{TemplateBinding Background}">
              <ToggleButton
                Name="HeaderSite"
                Focusable="False"
                IsTabStop="False"
                DockPanel.Dock="Top"
                BorderThickness="0"
                Cursor="Hand"
                IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                Style="{StaticResource MaterialDesignSlimFlatExpanderDownHeaderStyle}"
                Foreground="{TemplateBinding Foreground}"
                TextBlock.FontFamily="{TemplateBinding TextBlock.FontFamily}"
                TextBlock.FontSize="{TemplateBinding TextBlock.FontSize}"
                Content="{TemplateBinding Header}"
                ContentTemplate="{TemplateBinding HeaderTemplate}"
                ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
                ContentStringFormat="{TemplateBinding HeaderStringFormat}"/>
              <Border Name="ContentSite" DockPanel.Dock="Bottom">
                <StackPanel Name="ContentPanel" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                  <StackPanel.Height>
                    <MultiBinding Converter="{StaticResource MathMlpMultipleConverter}">
                      <Binding ElementName="PART_Content" Path="ActualHeight"/>
                      <Binding ElementName="PART_Content" Path="Opacity"/>
                    </MultiBinding>
                  </StackPanel.Height>
                  <StackPanel.Width>
                    <MultiBinding Converter="{StaticResource MathMlpMultipleConverter}">
                      <Binding ElementName="PART_Content" Path="ActualWidth"/>
                      <Binding ElementName="PART_Content" Path="Opacity"/>
                    </MultiBinding>
                  </StackPanel.Width>
                  <ContentPresenter Name="PART_Content" Focusable="False" ContentTemplate="{TemplateBinding ContentTemplate}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"/>
                </StackPanel>
              </Border>
            </DockPanel>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="ExpandDirection" Value="Right">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Right"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Horizontal"/>
              <Setter Property="Height" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignSlimFlatExpanderRightHeaderStyle}"/>
            </Trigger>

            <Trigger Property="ExpandDirection" Value="Left">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Left"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Horizontal"/>
              <Setter Property="Height" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignSlimFlatExpanderLeftHeaderStyle}"/>
            </Trigger>

            <Trigger Property="ExpandDirection" Value="Up">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Top"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Vertical"/>
              <Setter Property="Width" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignSlimFlatExpanderUpHeaderStyle}"/>
            </Trigger>

            <Trigger Property="ExpandDirection" Value="Down">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Top"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Bottom"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Vertical"/>
              <Setter Property="Width" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignSlimFlatExpanderDownHeaderStyle}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignRaisedCardExpander" BasedOn="{StaticResource MaterialDesignSlimFloatingExpander}" TargetType="{x:Type Expander}">
    <Setter Property="Background" Value="{DynamicResource MaterialDesignPaper}"/>
    <Setter Property="Margin" Value="0,4"/>
    <Setter Property="Padding" Value="4,2,4,4"/>
    <Setter Property="wpf:ShadowAssist.ShadowDepth" Value="Depth2"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Expander}">
          <wpf:Card Name="maskCard" Style="{DynamicResource MaterialDesignRaisedCard}" wpf:ShadowAssist.ShadowDepth="Depth1" VerticalAlignment="Stretch" Background="{TemplateBinding Background}" UniformCornerRadius="4">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="ExpansionStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="0" To="Expanded">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                        <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                      </ObjectAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="1" Duration="0:0:0.3"/>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition GeneratedDuration="0" To="Collapsed">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                        <DiscreteObjectKeyFrame KeyTime="0:0:0.3" Value="{x:Static Visibility.Collapsed}"/>
                      </ObjectAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="0" Duration="0:0:0.3"/>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Expanded">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="1" Duration="0"/>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Collapsed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="0" Duration="0"/>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <DockPanel Margin="{TemplateBinding Padding}">
              <ToggleButton
                Name="HeaderSite"
                Focusable="False"
                IsTabStop="False"
                DockPanel.Dock="Top"
                BorderThickness="0"
                Cursor="Hand"
                IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                Margin="2,0"
                Style="{StaticResource MaterialDesignSlimFlatExpanderDownHeaderStyle}"
                Foreground="{TemplateBinding Foreground}"
                TextBlock.FontFamily="{DynamicResource HeaderFontFamily}"
                TextBlock.FontSize="14"
                Content="{TemplateBinding Header}"
                ContentTemplate="{TemplateBinding HeaderTemplate}"
                ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
                ContentStringFormat="{TemplateBinding HeaderStringFormat}"/>
              <Border Name="ContentSite" DockPanel.Dock="Bottom">
                <StackPanel Name="ContentPanel" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                  <StackPanel.Height>
                    <MultiBinding Converter="{StaticResource MathMlpMultipleConverter}">
                      <Binding ElementName="PART_Content" Path="ActualHeight"/>
                      <Binding ElementName="PART_Content" Path="Opacity"/>
                    </MultiBinding>
                  </StackPanel.Height>
                  <StackPanel.Width>
                    <MultiBinding Converter="{StaticResource MathMlpMultipleConverter}">
                      <Binding ElementName="PART_Content" Path="ActualWidth"/>
                      <Binding ElementName="PART_Content" Path="Opacity"/>
                    </MultiBinding>
                  </StackPanel.Width>
                  <ContentPresenter Name="PART_Content" Focusable="False" ContentTemplate="{TemplateBinding ContentTemplate}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"/>
                </StackPanel>
              </Border>
            </DockPanel>
          </wpf:Card>
          <ControlTemplate.Triggers>
            <Trigger Property="ExpandDirection" Value="Right">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Right"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Horizontal"/>
              <Setter Property="Height" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignSlimFlatExpanderRightHeaderStyle}"/>
            </Trigger>

            <Trigger Property="ExpandDirection" Value="Left">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Left"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Horizontal"/>
              <Setter Property="Height" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignSlimFlatExpanderLeftHeaderStyle}"/>
            </Trigger>

            <Trigger Property="ExpandDirection" Value="Up">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Top"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Vertical"/>
              <Setter Property="Width" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignSlimFlatExpanderUpHeaderStyle}"/>
            </Trigger>

            <Trigger Property="ExpandDirection" Value="Down">
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Top"/>
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Bottom"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Vertical"/>
              <Setter Property="Width" TargetName="ContentPanel" Value="Auto"/>
              <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource MaterialDesignSlimFlatExpanderDownHeaderStyle}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MaterialDesignHeaderlessExpander" BasedOn="{StaticResource MaterialDesignExpander}" TargetType="{x:Type Expander}">
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue={StaticResource MaterialDesignBody}}"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Top"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Expander}">
          <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="ExpansionStates">
                <VisualStateGroup.Transitions>
                  <VisualTransition GeneratedDuration="0" To="Expanded">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                        <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                      </ObjectAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="1" Duration="0:0:0.3"/>
                    </Storyboard>
                  </VisualTransition>
                  <VisualTransition GeneratedDuration="0" To="Collapsed">
                    <VisualTransition.GeneratedEasingFunction>
                      <CubicEase EasingMode="EaseOut"/>
                    </VisualTransition.GeneratedEasingFunction>
                    <Storyboard>
                      <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                        <DiscreteObjectKeyFrame KeyTime="0:0:0.3" Value="{x:Static Visibility.Collapsed}"/>
                      </ObjectAnimationUsingKeyFrames>
                      <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="0" Duration="0:0:0.3"/>
                    </Storyboard>
                  </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Expanded">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="1" Duration="0"/>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Collapsed">
                  <Storyboard>
                    <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="0" Duration="0"/>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <DockPanel Background="{TemplateBinding Background}">
              <Border Name="ContentSite" DockPanel.Dock="Bottom">
                <StackPanel Name="ContentPanel" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                  <StackPanel.Height>
                    <MultiBinding Converter="{StaticResource MathMlpMultipleConverter}">
                      <Binding ElementName="PART_Content" Path="ActualHeight"/>
                      <Binding ElementName="PART_Content" Path="Opacity"/>
                    </MultiBinding>
                  </StackPanel.Height>
                  <StackPanel.Width>
                    <MultiBinding Converter="{StaticResource MathMlpMultipleConverter}">
                      <Binding ElementName="PART_Content" Path="ActualWidth"/>
                      <Binding ElementName="PART_Content" Path="Opacity"/>
                    </MultiBinding>
                  </StackPanel.Width>
                  <ContentPresenter Name="PART_Content" Focusable="False" ContentTemplate="{TemplateBinding ContentTemplate}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"/>
                </StackPanel>
              </Border>
            </DockPanel>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="ExpandDirection" Value="Right">
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Right"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Horizontal"/>
              <Setter Property="Height" TargetName="ContentPanel" Value="Auto"/>
            </Trigger>

            <Trigger Property="ExpandDirection" Value="Left">
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Left"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Horizontal"/>
              <Setter Property="Height" TargetName="ContentPanel" Value="Auto"/>
            </Trigger>

            <Trigger Property="ExpandDirection" Value="Up">
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Top"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Vertical"/>
              <Setter Property="Width" TargetName="ContentPanel" Value="Auto"/>
            </Trigger>

            <Trigger Property="ExpandDirection" Value="Down">
              <Setter Property="DockPanel.Dock" TargetName="ContentSite" Value="Bottom"/>
              <Setter Property="Orientation" TargetName="ContentPanel" Value="Vertical"/>
              <Setter Property="Width" TargetName="ContentPanel" Value="Auto"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="{x:Type Expander}" BasedOn="{StaticResource MaterialDesignRaisedCardExpander}" TargetType="{x:Type Expander}"/>

</ResourceDictionary>
